package org.ntu.rtsearch.search.model;

import java.util.Queue;

public class TopDocs {
	public int totalHit;
	
	public ScoreDoc[] scoreDocs;
	
	private double maxScore;
	
	public TopDocs(Queue<ScoreDoc> queue, int n) {
		n = Math.min(queue.size(), n);
		scoreDocs = new ScoreDoc[n];
		for (int i = n-1; i >= 0; i--) {
			scoreDocs[i] = queue.poll();
		}
		
		maxScore = scoreDocs[0].score;
		totalHit = n;
	}

	public double getMaxScore() {
		return maxScore;
	}
}
